//https://leetcode.cn/problems/que-shi-de-shu-zi-lcof/submissions/558011563/
class Solution {
    public int takeAttendance(int[] records) {
        //位运算
        int[] arr = new int[records.length+1];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = i;
        }
        int ret = 0;
        for (int i = 0; i < records.length; i++) {
            ret = ret ^ arr[i] ^ records[i];
        }
        ret ^= arr[arr.length-1];
        return ret;
    }
}